.aiChatContainer {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
  overflow: hidden;
  background-color: #f9f9f9;
  box-shadow: none;
}

.chatHeader {
  padding: 12px 16px;
  background-color: #4361ee;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.chatHeader h2 {
  font-size: 18px;
  margin: 0;
}

.modeSelector {
  display: flex;
  gap: 8px;
}

.modeSelector button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.modeSelector button.active {
  background: white;
  color: #4361ee;
  font-weight: bold;
}

.chatMessages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background-color: #f5f7fb;
  -webkit-overflow-scrolling: touch;
}

.message {
  display: flex;
  margin-bottom: 16px;
  max-width: 100%;
}

.message.user {
  flex-direction: row-reverse;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 8px;
  flex-shrink: 0;
  color: #4361ee;
  font-size: 18px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message.user .avatar {
  background-color: #4361ee;
  color: white;
}

.message .avatar svg {
  width: 18px;
  height: 18px;
}

.content {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  background-color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  line-height: 1.4;
  font-size: 14px;
  word-break: break-word;
}

.message.user .content {
  background-color: #4361ee;
  color: white;
}

.chatInput {
  display: flex;
  padding: 12px;
  background-color: white;
  border-top: 1px solid #e0e0e0;
  position: sticky;
  bottom: 0;
  z-index: 100;
}

.chatInput input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  outline: none;
  font-size: 14px;
  -webkit-appearance: none;
  margin: 0;
}

.chatInput input:focus {
  border-color: #4361ee;
}

.chatInput button {
  margin-left: 8px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background-color: #4361ee;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.chatInput button:disabled {
  background-color: #a0a0a0;
  cursor: not-allowed;
}

.loadingDots {
  display: flex;
  align-items: center;
  height: 20px;
}

.loadingDots div {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #4361ee;
  margin: 0 2px;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loadingDots div:nth-child(1) {
  animation-delay: -0.32s;
}

.loadingDots div:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0.6);
  }
  40% {
    transform: scale(1);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* 适配刘海屏 */
@supports (padding-top: env(safe-area-inset-top)) {
  .chatHeader {
    padding-top: calc(12px + env(safe-area-inset-top));
  }
  
  .chatInput {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

/* Markdown 样式 */
.paragraph {
  margin: 8px 0;
  line-height: 1.6;
}

.heading {
  margin: 16px 0 8px;
  font-weight: 600;
  line-height: 1.4;
}

.heading:first-child {
  margin-top: 0;
}

.list {
  margin: 8px 0;
  padding-left: 20px;
}

.listItem {
  margin: 4px 0;
  line-height: 1.6;
}

.blockquote {
  margin: 8px 0;
  padding: 8px 16px;
  border-left: 4px solid #4361ee;
  background-color: rgba(67, 97, 238, 0.05);
  border-radius: 4px;
}

.inlineCode {
  padding: 2px 4px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
}

.codeBlock {
  margin: 12px 0;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f6f8fa;
}

.codeHeader {
  padding: 8px 12px;
  background-color: #e1e4e8;
  border-bottom: 1px solid #d1d5da;
  font-size: 12px;
  color: #586069;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.codeContent {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
  font-size: 13px;
  line-height: 1.5;
}

.codeContent code {
  font-family: inherit;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .codeBlock {
    margin: 8px -12px;
    border-radius: 0;
  }

  .codeContent {
    padding: 8px;
    font-size: 12px;
  }

  .heading {
    font-size: 1.1em;
  }

  .paragraph {
    font-size: 14px;
  }
} 